package com.example.seataBusiness.feign;

import com.example.seataBusiness.common.response.ObjectResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "seata-order")
public interface OrderServiceFeignClient {

    /**
     * 创建订单服务接口
     *
     * @param userId        用户ID
     * @param commodityCode 产品编号
     * @param count         订单产品数量
     * @param orderMoney    订单总金额
     */
    @PostMapping("/order")
    ObjectResponse<Object> createOrder(@RequestParam("userId") String userId,
                                      @RequestParam("commodityCode") String commodityCode,
                                      @RequestParam("count") Integer count,
                                      @RequestParam("orderMoney") Double orderMoney);
}
